package Exams.MeituanPack.q2021.q06_region;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        boolean[] selected = new boolean[n + 1];
        for(int i = 0; i < n; i++){
            String[] elem = br.readLine().split(" ");
            for(int k = 0; k < elem.length; k++){
                int index = Integer.parseInt(elem[k]);
                if(!selected[index]){
                    selected[index] = true;
                    System.out.print(index + " ");
                    break;
                }
            }
        }
    }


}
